<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>AJAX</title>
    <style>
        #box{
            padding: 20px;
            background-color: #feeeed;
        }
    </style>
</head>
<body>
    <h1>AJAX</h1>
    <button>加载</button>
    <div id="box"></div>

    <script src="__PUBLIC__/js/jquery.min.js"></script>
    <script>
        $(function(){
            $('button').click(function(){
                /*$.ajax({
                    type:'get',
                    url:"<{:U('Stu/doAjax')}>",
                    dataType: 'json',
                    success:function(data){
                        console.log(data);
                    },
                })*/
                $.ajax({
                    type:'get',
                    url:"<{:U('User/index')}>",
                    success:function(data){
                        $('#box').html(data);
                    },
                })
            })
        })
    </script>
</body>
</html>